package prog.view;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import java.awt.GridBagConstraints;
import java.awt.Insets;

/**
 *
 * @author MrKhoai
 */
public class MyGridBagConstraints extends GridBagConstraints{
    public static final GridBagConstraints createFixedConStraints(int gridx, int gridy, int gridwidth, int gridheight, int anchor,
                                                                                        int tgap, int lgap, int bgap, int rgap) {

        GridBagConstraints fixed = new GridBagConstraints(gridx, gridy, gridwidth, gridheight, 0.0, 0.0,
                anchor, GridBagConstraints.NONE, new Insets(tgap, lgap, bgap, rgap), 0, 0);
        return fixed;
    }

    public static final GridBagConstraints createHorzConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weightx,
                                                                                            int tgap, int lgap, int bgap, int rgap) {

        GridBagConstraints horz = new GridBagConstraints(gridx, gridy, gridwidth, gridheight, weightx, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(tgap, lgap, bgap, rgap), 0, 0);
        return horz;
    }

    public static final GridBagConstraints createVertConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weighty,
                                                                                            int tgap, int lgap, int bgap, int rgap) {

        GridBagConstraints vert = new GridBagConstraints(gridx, gridy, gridwidth, gridheight, 0.0, weighty,
                GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(tgap, lgap, bgap, rgap), 0, 0);
        return vert;
    }

    public static final GridBagConstraints createBothConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty,
                                                                                                            int tgap, int lgap, int bgap, int rgap) {

        GridBagConstraints both = new GridBagConstraints(gridx, gridy, gridwidth, gridheight, weightx, weighty,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(tgap, lgap, bgap, rgap), 0, 0);
        return both;
    }
}
